﻿
@{
    ViewBag.Title = "Index";
}

<style>
    body,
    html,
    #container {
        overflow: hidden;
        width: 100%;
        height: 500px;
        margin: 0;
        font-family: "微软雅黑";
    }
</style>
<body>
    <input type="text" id="name" value="" />
    <input type="button" onclick="get()" value="查询" />
    <div id="container"></div>
</body>
<script src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=0hWysXjZ2Isi8B6L6Au0aruTcFgX50Nf"></script>
<script>
    $(function() {
        get();
    })
    function get() {
        var name = "西安市";
        if ($("#name").val() != "") {
            var name = $("#name").val();
        }
        var map = new BMapGL.Map('container'); // 创建Map实例
        map.centerAndZoom(name, 12); // 初始化地图,设置中心点坐标和地图级别
        map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放
    }
</script>


